package co.gov.medellin.ssti.sub.model.service.impl;

import java.io.UnsupportedEncodingException;
import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import co.gov.medellin.ssti.sub.model.dao.VerificacionDAO;
import co.gov.medellin.ssti.sub.model.dao.exception.DAOException;
import co.gov.medellin.ssti.sub.model.service.VerificacionService;
import co.gov.medellin.ssti.sub.model.vo.VerificacionVO;

@Service
public class VerificacionServiceImpl implements VerificacionService {
	@Autowired
	VerificacionDAO verificacionDAOImpl2;

	public void uploadFile(byte[] fileData, String nomUser)
			throws UnsupportedEncodingException {
		try {
			verificacionDAOImpl2.uploadFile(fileData, nomUser);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public int deleteRecordsOld(String nomUser) {
		try {
			return verificacionDAOImpl2.deleteRecordsOld(nomUser);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public Collection<VerificacionVO> findVerificationBeneficiarioBeneficio(
			String nomUser) {
		try {
			return verificacionDAOImpl2
					.findVerificationBeneficiarioBeneficio(nomUser);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<VerificacionVO> findVerificationSisben(String nomUser) {
		try {
			return verificacionDAOImpl2.findVerificationSisben(nomUser);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	@Override
	public Collection<VerificacionVO> findVerificationBeneficiario(
			String nomUser) {
		try {
			return verificacionDAOImpl2.findVerificationBeneficiario(nomUser);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

}
